From 8d8e0444581e97d7664c206f06edaefc3b1cf56e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 10 May 2023 12:41:43 -0400 Subject: [PATCH] upgrade: Support --json and --json-error-messages and --json-progress Seems unlikely to be very useful, but trivial. Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project --- CHANGELOG | 3 ++- Command/Upgrade.hs | 1 + doc/git-annex-upgrade.mdwn | 10 ++++++++++ ...on_for_unannex__and_ideally_any_other_command_.mdwn | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 72ef2198b4..e90bd1cd5e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -40,7 +40,8 @@ git-annex (10.20230408) UNRELEASED; urgency=medium * Support --json and --json-error-messages in more commands (addunused, dead, describe, dropunused, expire, fix, importfeed, init, log, merge, migrate, reinit, reinject, rekey, renameremote, rmurl, - semitrust, setpresentkey, trust, unannex, undo, untrust, unused) + semitrust, setpresentkey, trust, unannex, undo, untrust, unused, + upgrade) * log: When --raw-date is used, display only seconds from the epoch, as documented, omitting a trailing "s" that was included in the output before. diff --git a/Command/Upgrade.hs b/Command/Upgrade.hs index 77f569a15b..31600fabec 100644 --- a/Command/Upgrade.hs +++ b/Command/Upgrade.hs @@ -20,6 +20,7 @@ cmd = dontCheck repoExists $ -- avoid upgrading repo out from under daemon noDaemonRunning $ + withAnnexOptions [jsonOptions] $ command "upgrade" SectionMaintenance "upgrade repository" paramNothing (seek <$$> optParser) diff --git a/doc/git-annex-upgrade.mdwn b/doc/git-annex-upgrade.mdwn index a74bfeb623..0b22067816 100644 --- a/doc/git-annex-upgrade.mdwn +++ b/doc/git-annex-upgrade.mdwn @@ -31,6 +31,16 @@ allow archives to be taken offline for years and later used. Only do whatever automatic upgrade can be done, don't necessarily upgrade to the latest version. This is used internally by git-annex. +* `--json` + + Enable JSON output. This is intended to be parsed by programs that use + git-annex. + +* `--json-error-messages` + + Messages that would normally be output to standard error are included in + the JSON instead. + * Also the [[git-annex-common-options]](1) can be used. # SEE ALSO diff --git a/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn index 94f7552e2e..e67a05daea 100644 --- a/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn +++ b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn @@ -38,13 +38,13 @@ These commands have been updated to support --json: * git-annex-renameremote * git-annex-importfeed * git-annex-merge +* git-annex-upgrade Provisional list of commands that don't support --json and maybe should: * git-annex-configremote * git-annex-enableremote * git-annex-initremote -* git-annex-upgrade These commands could support json, but I punted: -- 2.30.2